From 517cea36ed31a2326bc453701ef17e98b0a8ccca Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 27 Oct 2015 03:11:21 +0100 Subject: [PATCH] cssmatcher: Actually match names for widget paths The type is always 0 when we use names. So this would always return FALSE. Oops. --- gtk/gtkcssmatcher.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gtk/gtkcssmatcher.c b/gtk/gtkcssmatcher.c index 71a4cba0a0..8dd26d52fe 100644 --- a/gtk/gtkcssmatcher.c +++ b/gtk/gtkcssmatcher.c @@ -79,16 +79,17 @@ gtk_css_matcher_widget_path_has_name (const GtkCssMatcher *matcher, { const GtkWidgetPath *siblings; - if (type == 0) - return FALSE; - siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index); if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index)) { const char *path_name = gtk_widget_path_iter_get_object_name (siblings, matcher->path.sibling_index); if (path_name == NULL) - return g_type_is_a (gtk_widget_path_iter_get_object_type (siblings, matcher->path.sibling_index), type); + { + if (type == 0) + return FALSE; + return g_type_is_a (gtk_widget_path_iter_get_object_type (siblings, matcher->path.sibling_index), type); + } return path_name == name; } @@ -97,7 +98,11 @@ gtk_css_matcher_widget_path_has_name (const GtkCssMatcher *matcher, const char *path_name = gtk_widget_path_iter_get_object_name (matcher->path.path, matcher->path.index); if (path_name == NULL) - return g_type_is_a (gtk_widget_path_iter_get_object_type (matcher->path.path, matcher->path.index), type); + { + if (type == 0) + return FALSE; + return g_type_is_a (gtk_widget_path_iter_get_object_type (matcher->path.path, matcher->path.index), type); + } return path_name == name; } -- 2.30.2